<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>物流发货管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
		});
	</script>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content">
	<div class="ibox">
	<div class="ibox-title">
		<h5>订单列表 </h5>
	</div>
    <div class="ibox-content">
	<sys:message content="${message}"/>
	
	<!--查询条件-->
	<div class="row">
	<div class="col-sm-12">
	<form:form id="searchForm" modelAttribute="logisDelivery" action="${ctx}/${url}" method="post" class="form-inline">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
		<div class="form-group">
			<span>单号：</span>
				<form:input path="id" htmlEscape="false" maxlength="32"  class=" form-control input-sm"/>
			<span>货物名称：</span>
				<form:input path="goodsName" htmlEscape="false" maxlength="64"  class=" form-control input-sm"/>
			<span>支付状态：</span>
			<form:select path="payStatus"  class="form-control m-b">
				<form:option value="" label="全部"/>
				<form:options items="${fns:getDictList('pay_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</form:select>
			<c:if test="${logisDelivery.auditStatus eq '0'  }">
			<span>物流状态：</span>
			<form:select path="status"  class="form-control m-b">
				<form:option value="" label="全部"/>
				<form:options items="${fns:getDictList('logis_delivery_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</form:select>
			</c:if>

			<c:if test="${logisDelivery.auditStatus eq '1'  }">
				<span>订单状态：</span>
				<form:select path="status"  class="form-control m-b">
					<form:option value="" label="全部"/>
					<form:options items="${fns:getDictList('logis_delivery_status2')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</c:if>
			<div class="pull-right">
				<button  class="btn btn-primary btn-sm " onclick="search()" ><i class="fa fa-search"></i> 查询</button>
			</div>
		 </div>	
	</form:form>
	<br/>
	</div>
	</div>

	
	<!-- 表格 -->
	<table id="contentTable" class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
		<thead>
			<tr>
				<th  class="sort-column id">单号</th>
				<th>下单人昵称</th>
				<th>下单人手机</th>
				<th>发货地-目的地</th>
				<th  class="sort-column goodsName">货物名称</th>
				<th  class="sort-column goodsWeight">货物重量</th>
				<th  class="sort-column ownerUnitPrice">货主单价</th>
				<th  class="sort-column driverUnitPrice">司机单价</th>
				<c:if test="${url eq '/logis/logisDelivery/'}">
				<th  class="sort-column payStatus">支付状态</th>
				</c:if>
				<c:if test="${url eq '/logis/logisDelivery/wholeCar'}">
					<th  class="sort-column payStatus">物流节点</th>
				</c:if>
				<th  class="sort-column createDate">创建时间</th>
				<th width="8%">操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="logisDelivery">
			<tr>
				<td>
						${logisDelivery.id}
				</td>
				<td>
					${logisDelivery.consignerName}
				</td>
				<td>
						${logisDelivery.consignerMobile}
				</td>


				<td>
					${logisDelivery.startProvince}${logisDelivery.startCity}<br/>
					${logisDelivery.endProvince}${logisDelivery.endCity}
				</td>

				<td>
					${logisDelivery.goodsName}
				</td>
				<td>
					预估:${logisDelivery.estimateWeight}<br/>
					实际:${logisDelivery.goodsWeight}
				</td>
				<td>
						${logisDelivery.ownerUnitPrice}
				</td>
				<td>
					${logisDelivery.driverUnitPrice}
				</td>



				<td>
					<c:if test="${url eq '/logis/logisDelivery/'}">
						${fns:getDictLabel(logisDelivery.payStatus, 'pay_status', '')}
					</c:if>
					<c:if test="${url eq '/logis/logisDelivery/wholeCar'}">
					<a onclick="openDialogView('状态历史详情', '${ctx}/logis/logisDelivery/viewDeliveryLogs?id=${logisDelivery.id}','480px', '520px')"  >状态历史</a>
					</c:if>
				</td>

				<td>
					<fmt:formatDate value="${logisDelivery.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>

				<td>
					<c:if test="${logisDelivery.auditStatus eq '1' && logisDelivery.payStatus ne '2'  && logisDelivery.status ne '14' && logisDelivery.status ne '15'&& logisDelivery.status ne '16'&& logisDelivery.status ne '17' }">
					<shiro:hasPermission name="logis:logisDelivery:view" >
						<a href="#" onclick="openDialog('客服核实重量', '${ctx}/logis/logisDelivery/form?id=${logisDelivery.id}','860px', '620px')" class="btn btn-success btn-xs" >核实重量</a>
					</shiro:hasPermission>
						<a href="${ctx}/logis/logisDelivery/delCarrier?id=${logisDelivery.id}" onclick="return confirmx('确认要取消司机接单吗？', this.href)"   class="btn btn-warning btn-xs">取消接单</a>
					</c:if>
					<c:if test="${logisDelivery.auditStatus eq '0' &&logisDelivery.payStatus eq '1' &&logisDelivery.status eq '12'  }">
					<a href="#" onclick="openDialog('审核与确认物流发货', '${ctx}/logis/logisDelivery/form?id=${logisDelivery.id}','860px', '620px')" class="btn btn-success btn-xs" >客服审核</a>
					<a href="${ctx}/logis/logisDelivery/auditPass?id=${logisDelivery.id}" onclick="return confirmx('确认要发布通过发布吗？', this.href)"   class="btn btn-primary btn-xs">客服发布</a>
					</c:if>

						<shiro:hasPermission name="logis:logisDelivery:view" >
							<a href="#" onclick="openDialog('查看详情', '${ctx}/logis/logisDelivery/form?id=${logisDelivery.id}','860px', '620px')" class="btn btn-info btn-xs" >查看详情</a>
						</shiro:hasPermission>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	
		<!-- 分页代码 -->
	<table:page page="${page}"></table:page>
	<br/>
	<br/>
	</div>
	</div>
</div>
</body>
</html>